package io.bsly.modules.sys.controller;

import io.bsly.common.utils.PageUtils;
import io.bsly.common.utils.R;
import io.bsly.modules.app.entity.sourceEntity.HotelEntity;
import io.bsly.modules.app.pojo.HotelVo;
import io.bsly.modules.app.service.sourceDb.HotelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "后台酒店接口")
@RestController
@RequestMapping("sys/hotel")
public class SysHotelController {
    @Autowired
    private HotelService hotelService;

    /**
     * 列表
     */
    @ApiOperation("分页展示")
    @GetMapping("/list")
    public R list(HotelVo vo){
        PageUtils page = hotelService.queryPage(vo);
        return R.ok().put("page", page);
    }



    /**
     * 信息
     */
    @ApiOperation("根据ID查询")
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		HotelEntity hotel = hotelService.getById(id);
        return R.ok().put("hotel", hotel);
    }



}
